package com.yf.zzmusic.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.ZoneOffset;

import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 轮播图
 * </p>
 *
 * @author
 * @since 2024-02-28
 */
@Getter
@Setter
@TableName("slide")
public class Slide implements Serializable {

  private static final long serialVersionUID = 1L;

  /**
   * 轮播图id
   */
  @TableId(value = "slide_id", type = IdType.AUTO)
  private Integer slideId;

  /**
   * 轮播图名称
   */
  private String slideName;

  /**
   * 轮播图封面地址
   */
  private String slideCover;

  /**
   * 创建时间
   */
  private LocalDateTime createTime;

  public Long getCreateTime() {
    if (createTime!=null){
      long timestamp = createTime.toInstant(ZoneOffset.of("+8")).toEpochMilli();
      return timestamp;
    }else{
      return null;
    }

  }

  public void setCreateTime(LocalDateTime createTime) {
    this.createTime = createTime;
  }
}
